package com.xinxi11.project.qx.beans;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.xinxi11.module.core.entity.RecordSupport;

/**
 * 用户信息,只保留权限系统可能会用到的属性,其它的可以删除不用.
 */
@Entity
@Table(name = "[User]", uniqueConstraints = { @UniqueConstraint(columnNames = "Name"),
		@UniqueConstraint(columnNames = "UserCode") })
@AttributeOverrides({ @AttributeOverride(name = "remark", column = @Column(name = "Health")),
		@AttributeOverride(name = "createTime", column = @Column(name = "cteateTime")) })
public class QxUser extends RecordSupport<Long> {

	private static final long serialVersionUID = -7156296384121188274L;

	private String userCode;
	private String name;
	private String email;
	private String sex;
	private String phone;
	private String mobile;
	private Integer unitId;
	private Integer userWorkState;

	public QxUser() {
	}

	@Override
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	@Column(name = "UserCode", unique = true, nullable = false, length = 300)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Column(name = "Name", unique = true, nullable = false, length = 200)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "email", length = 100)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "Sex")
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "mobile")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "UnitID")
	public Integer getUnitId() {
		return this.unitId;
	}

	public void setUnitId(Integer unitId) {
		this.unitId = unitId;
	}

	@Column(name = "UserWorkState")
	public Integer getUserWorkState() {
		return this.userWorkState;
	}

	public void setUserWorkState(Integer userWorkState) {
		this.userWorkState = userWorkState;
	}

}